package artibella.media.controls.ui 
{
	import flash.display.JointStyle;
	import flash.display.LineScaleMode;
	import flash.display.MovieClip;
	
	/**
	 * ...
	 * @author pbordachar
	 */
	
	public class PlayPauseButton extends MovieClip
	{
		private var _clr:int;
		
		public function PlayPauseButton( c:int = 0 ) 
		{
			_clr = c;
			
			_init();
		}
		
		private function _init():void
		{
			buttonMode = true;
			
			drawPlay();
		}
		
		// - - -
		
		public function drawPlay():void
		{
			graphics.clear();
			
			graphics.lineStyle( 1, _clr, .6, false, LineScaleMode.NONE, null, JointStyle.MITER );
			graphics.beginFill( _clr, 0 );
			graphics.drawCircle( 0, 0, 8 );
			graphics.endFill();
			
			graphics.lineStyle();
			graphics.beginFill( _clr, 1 );
			graphics.moveTo( -2, -5 );
			graphics.lineTo( 5, 0 );
			graphics.lineTo( -2, 5 );
			graphics.endFill();
		}
		
		public function drawPause():void
		{
			graphics.clear();	
			
			graphics.lineStyle( 1, _clr, .6, false, LineScaleMode.NONE, null, JointStyle.MITER );
			graphics.beginFill( _clr, 0 );
			graphics.drawCircle( 0, 0, 8 );
			graphics.endFill();
			
			graphics.lineStyle();
			graphics.beginFill( _clr, 1 );
			graphics.drawRect( -3, -3, 2, 6 );
			graphics.drawRect( 1, -3, 2, 6 );
			graphics.endFill();
		}
	}
}